/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: Mmc driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_MMC_HOOKS

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mmc

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_MMC_HOOKS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MMC_HOOKS_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>

struct mmc_card;
struct dw_mci;
struct platform_device;

DECLARE_HOOK(vendor_mmc_init_card,
	TP_PROTO(struct mmc_card *card),
	TP_ARGS(card));

DECLARE_HOOK(vendor_dwmmc_set_cmd_flags,
	TP_PROTO(u32 *flags),
	TP_ARGS(flags));

DECLARE_HOOK(vendor_dwmmc_mci_get_cd,
	TP_PROTO(struct dw_mci *host, int *present, int *ret),
	TP_ARGS(host, present, ret));

DECLARE_HOOK(vendor_dwmmc_state_set_drto,
	TP_PROTO(struct dw_mci *host, u32 status, void (*dw_mci_set_drto)(struct dw_mci *host)),
	TP_ARGS(host, status, dw_mci_set_drto));

DECLARE_HOOK(vendor_dwmmc_mci_handle_cd,
	TP_PROTO(struct dw_mci *host),
	TP_ARGS(host));

DECLARE_HOOK(vendor_dwmmc_mci_err_handle,
	TP_PROTO(struct dw_mci *host, u32 pending),
	TP_ARGS(host, pending));

DECLARE_HOOK(vendor_dwmmc_cd_int_enable,
	TP_PROTO(struct dw_mci *card, int *ret),
	TP_ARGS(card, ret));

DECLARE_HOOK(vendor_mmc_is_probe,
	TP_PROTO(struct platform_device *pdev, struct dw_mci *host, int *ret),
	TP_ARGS(pdev, host, ret));

DECLARE_HOOK(vendor_dwmmc_get_busy_mask,
	TP_PROTO(u32 *status_busy_mask),
	TP_ARGS(status_busy_mask));

#endif
/* This part must be outside protection */

#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>

struct mmc_card;
struct dw_mci;
struct platform_device;

DECLARE_EVENT_NOP(vendor_mmc_init_card,
	TP_PROTO(struct mmc_card *card),
	TP_ARGS(card));

DECLARE_EVENT_NOP(vendor_dwmmc_set_cmd_flags,
	TP_PROTO(u32 *flags),
	TP_ARGS(flags));

DECLARE_EVENT_NOP(vendor_dwmmc_mci_get_cd,
	TP_PROTO(struct dw_mci *host, int *present, int *ret),
	TP_ARGS(host, present, ret));

DECLARE_EVENT_NOP(vendor_dwmmc_state_set_drto,
	TP_PROTO(struct dw_mci *host, u32 status, void (*dw_mci_set_drto)(struct dw_mci *host)),
	TP_ARGS(host, status, dw_mci_set_drto));

DECLARE_EVENT_NOP(vendor_dwmmc_mci_handle_cd,
	TP_PROTO(struct dw_mci *host),
	TP_ARGS(host));

DECLARE_EVENT_NOP(vendor_dwmmc_mci_err_handle,
	TP_PROTO(struct dw_mci *host, u32 pending),
	TP_ARGS(host, pending));

DECLARE_EVENT_NOP(vendor_dwmmc_cd_int_enable,
	TP_PROTO(struct dw_mci *card, int *ret),
	TP_ARGS(card, ret));

DECLARE_EVENT_NOP(vendor_mmc_is_probe,
	TP_PROTO(struct platform_device *pdev, struct dw_mci *host, int *ret),
	TP_ARGS(pdev, host, ret));

DECLARE_EVENT_NOP(vendor_dwmmc_get_busy_mask,
	TP_PROTO(u32 *status_busy_mask),
	TP_ARGS(status_busy_mask));
#endif /* CONFIG_VENDOR_MMC_HOOKS */

